<template>
	<view class="page">
		<view class="bg-white">
			<up-tabs :list="list1" :scrollable="false" @click="tabClick"></up-tabs>
		</view>
		<view class="padding" v-if="currentTab === 0">
			<view class="margin-bottom radius-lg bg-white flex align-center justify-between padding"
				v-for="item in untToldQuestionList" :key="item.id" @click="handleMistakeDetailClick(item)">
				<u-text bold :text="`${item.title} (${item.count})`" size="32rpx" color="#333"></u-text>
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="padding" v-if="currentTab === 1">
			<view class="margin-bottom radius-lg bg-white flex align-center justify-between padding"
				v-for="item in untToldQuestionList" :key="item.id" @click="handleMistakeDetailClick(item)">
				<u-text bold :text="`${item.title} (${item.count})`" size="32rpx" color="#333"></u-text>
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
	</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';

const id = ref(0);
const classType = ref(0);

onLoad((options) => {
	id.value = options.id;
	classType.value = options.classType;
	uni.setNavigationBarTitle({
		title: classType.value === 1 ? '周末班：一年级·数学（A）班' : '托管班：一年级（A）班'
	})
});
const currentTab = ref(0)
// 创建响应式数据  
const list1 = reactive([
	{ name: '待确认（3）' },
	{ name: '已确认（3）' },
]);

const untToldQuestionList = ref([
	{
		id: 1,
		title: '李同学',
		count: 8,
	},
	{
		id: 2,
		title: '王同学',
		count: 8,
	},
]);

const handleMistakeDetailClick = (item) => {
	console.log('item', item)
	uni.navigateTo({
		url: `/pages/teacher/confirmKnowledge/detail?id=${item.id}`
	})
}


const tabClick = (index) => {
	console.log('index', index)
	currentTab.value = index.index
}
</script>